<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName"
           value="${message(code: 'workflowInstanceStage.label', default: 'WorkflowInstanceStage')}"/>
    <title>新增区域-工作流</title>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li>
                        <g:link controller="workflowInstance" action="index">工作流</g:link>
                    </li>
                    <li class="active">
                        <span>新增工作流</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                新增工作流
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hblue">
            <div class="panel-heading">
                新增工作流
            </div>

            <div class="panel-body">
                <g:form resource="${this.workflowInstanceStage}" method="PUT" action="update" class="form-horizontal">
                    <g:if test="${flash.message}">
                        <div class="message" role="status">${flash.message}</div>
                    </g:if>
                    <g:hasErrors bean="${this.workflowInstanceStage}">
                        <ul class="errors" role="alert">
                            <g:eachError bean="${this.workflowStage}" var="error">
                                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                                        error="${error}"/></li>
                            </g:eachError>
                        </ul>
                    </g:hasErrors>

                    <g:textField class="form-control hidden"  type="text" name="targetUri" id="targetUri" value="${params.targetUri}"/>
                   <g:textField class="form-control hidden"   name="instance.id" required="required"  value="${this.workflowInstanceStage?.instance?.id}"/>


                    <div class="form-group">
                        <label class="col-md-4 control-label">订单阶段</label>
                        <div class="col-md-3">
                            <g:textField  class="form-control" name="name" required value="${this.workflowInstanceStage?.name}" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-4 control-label">执行次序</label>
                        <div class="col-md-3">
                            <g:textField name="executionSequence"
                                         value="${this.workflowInstanceStage?.executionSequence}"
                                         class="form-control"/>
                        </div>
                    </div>

                    <div class="form-group ">
                        <label class="col-md-4 control-label">是否回退</label>
                        <div class="col-md-3 checkbox-inline">
                            <g:radioGroup class="checkbox-inline" name="canReject" value="${this.workflowInstanceStage?.canReject}" labels="['是','否']" values="[true,false]">
                                ${it.radio} ${it.label}
                            </g:radioGroup>
                        </div>
                    </div>

                    <div class="form-group">
                          <label class="col-md-4 control-label">页面布局</label>
                          <div class="col-md-3">
                              <g:select class="form-control" name="layout.id"
                                        value="${this.workflowInstanceStage?.layout?.id}"
                                        required="required" id="layout"
                                        from="${com.cindata.Layout.findAllByActive(true)}" optionKey="id"
                                        optionValue="description" noSelection="${['null': '请选择']}"></g:select>

                          </div>
                      </div>

                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-3">
                            <g:submitButton class="btn btn-info" id="btn" name="update" value="保存"/>
                        </div>
                    </div>
                </g:form>
            </div>
        </div>
    </div>
</div>

</body>
</html>
